from django.db import models

# Create your models here.
class userInfo(models.Model):
    username=models.CharField(max_length=255,unique=True,null=False)
    password=models.CharField(max_length=255,null=False)
    biography=models.TextField()

class track(models.Model):
    title=models.CharField(max_length=64,null=False)
    duration=models.IntegerField()

class playrecord(models.Model):
    play_date=models.DateField(auto_now_add=True)
    play_time=models.IntegerField(default=1)
    track_id=models.ForeignKey(track,on_delete=models.CASCADE,related_name='playrecord')
    user_id=models.ForeignKey(userInfo,on_delete=models.CASCADE,related_name='playrecord')
